apiVersion: apps/v1
kind: Deployment
metadata:
  name: {APP_NAME}
  labels:
    app: {APP_NAME}
spec:
  replicas: 1
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1 # 升级过程中最多可以比原先设置多出的POD数量
      maxUnavailable: 1 # 升级过程中最多有多少个POD处于无法提供服务的状态
  selector:
    matchLabels:
      app: {APP_NAME}
  template:
    metadata:
      labels:
        app: {APP_NAME}
    spec:
      containers:
      - name: {APP_NAME}
        image: {IMAGE_URL}:{IMAGE_TAG}
        ports:
        - containerPort: 8088
        env:
          - name: SPRING_PROFILES_ACTIVE
            value: {SPRING_PROFILE}
---
apiVersion: v1
kind: Service
metadata:
  name: {APP_NAME}
spec:
  type: NodePort
  ports:
  - name: http
    port: 21088
    nodePort: 31088
    targetPort: 8088
    protocol: TCP
  selector:
    app: {APP_NAME}
